//
//  GTLibCoreEventModel.swift
//  lib_core
//
//  Created by Shper on 2023/7/2.
//

import Foundation


public enum GTGlobalConfigEventAction: String, Codable {
    public typealias RawValue = String

    case darkMode // 浅色深色模式切换
    case language  // 语言切换
    case hzldMode // 红涨绿跌切换
    case timezone // 涨跌幅时间切换
    case exchangeRate  // 汇率切换
    case hiddenMoney  // 是否隐藏资金
}


public struct GTGlobalConfigEventModel: Codable, GTFlutterEventModel {
    
    public var actionType = "GTGlobalConfigEventAction"

    public var actionName: String
    
    var action: GTGlobalConfigEventAction
    
    var darkMode: Bool?
    
    var language: String?
    
    var hzldMode: Bool?
    
    var exchangeRate: [String: Double]?
    
    var timezone: String?
    
    var hiddenMoney: Bool?
    
    public init(action: GTGlobalConfigEventAction, 
                darkMode: Bool? = nil,
                language: String? = nil,
                hzldMode: Bool? = nil,
                timezone:String? = nil,
                exchangeRate: [String: Double]? = nil,
                hiddenMoney: Bool? = nil) {
        self.action = action
        self.actionName = action.rawValue
        
        self.darkMode = darkMode
        self.language = language
        self.hzldMode = hzldMode
        
        self.timezone = timezone
        self.exchangeRate = exchangeRate
        self.hiddenMoney = hiddenMoney
    }

}
